package demo.generic;

import lombok.Data;

/**
 * @ClassName GeneticClassExample
 * @Description
 * @Author 47980
 * @Date 2020/6/8 21:46
 * @Version V_1.0
 **/
@Data
public class GeneticClassExample<T> {
    // member 成员类型为T，此T为外部传入变量
    private T member;

    public GeneticClassExample(T member) {
        this.member = member;
    }

    public T handleSomething(T target) {
        return target;
    }

    public static <E> void printArray(E[] inputArray) {
        for (E element : inputArray) {
            System.out.printf("%s", element);
            System.out.printf(" ");
        }
        System.out.println();
    }
}
